/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	RenderEntryDispatchCompute.cpp
*
*	Comments	-	See RenderEntryDispatchCompute.h
*
**************************************************************************************/
#include "../Include/RenderEntryDispatchCompute.h"
#include "../Include/GraphicsPipeline.h"

namespace Pulse
{
	RenderEntryDispatchCompute::RenderEntryDispatchCompute( void )
		: m_pRenderPass( PSX_NULL ), m_threadCountX( 0 ), m_threadCountY( 0 ), m_threadCountZ( 0 )
	{

	}

	RenderEntryDispatchCompute::~RenderEntryDispatchCompute( void )
	{

	}

	void RenderEntryDispatchCompute::SetThreadCounts( UINT threadCountX, UINT threadCountY, UINT threadCountZ )
	{
		m_threadCountX = threadCountX;
		m_threadCountY = threadCountY;
		m_threadCountZ = threadCountZ;
	}

	void RenderEntryDispatchCompute::PreExecute( GraphicsPipeline *pPipeline )
	{

	}

	void RenderEntryDispatchCompute::Execute( GraphicsPipeline *pPipeline )
	{
		// bind parameters
		m_parameters.BindParameters();

		pPipeline->CSClearStates();
		m_pRenderPass->ConfigurePipeline( pPipeline );
		pPipeline->CSBindStates();

		pPipeline->Dispatch( m_threadCountX, m_threadCountY, m_threadCountZ );
	}

	void RenderEntryDispatchCompute::PostExecute( GraphicsPipeline *pPipeline )
	{

	}
}